<?php
/**
 * Created by PhpStorm.
 * User: kongqi
 * Date: 2019/10/4
 * Time: 13:16
 */

namespace App\Plugin\HostServer\Models;

class PnHostSvUserLog extends HostServerBase
{

    /**
     * 取得会员
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo(PnHostSvUser::class, 'user_id', 'id');
    }

    public static function add($type,$name, $user_id)
    {
        $data = [
            'group_type'=>$type,
            'user_id' => $user_id,
            'name' => $name,
            'ip' => request()->getClientIp()
        ];
        $r = self::create($data);
    }


}